#include"http.hpp"
int main()
{
    //测试超时连接
    Socket client;
    client.CreateClient(8888,"127.0.0.1");
    std::string req="get /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    client.Send(req.c_str(),req.size());
    char buffer[1024]={0};
    int n=client.Recv(buffer,1023);
    buffer[n]=0;
    INFO_LOG("[%s]",buffer);
    sleep(30);
    client.Send(req.c_str(),req.size());
    if(client.Recv(buffer,1023)==-1)
    {
        INFO_LOG("连接断开");
        client.Close();
        return 0;
    }
    buffer[n]=0;
    INFO_LOG("[%s]",buffer);
    client.Close();
    return 0;
}